﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="KHSFMXB.aspx.cs" Inherits="ZHCX_KHSFMXB" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
  <title></title>
  <style type="text/css">
    .table
    {
      border: solid #add9c0;
      border-width: 1px 0px 0px 1px;
      text-align: center;
      font-size: 12px;
    }
    .table td
    {
      border: solid #add9c0;
      border-width: 0px 1px 1px 0px;
    }
  </style>
  <script type="text/javascript">

    //分别是奇数行默认颜色,偶数行颜色,鼠标放上时奇偶行颜色 
    var aBgColor = ["#f2faff", "#FFFFFF", "#FFFFCC", "#FFFFCC"];
    //从前面iHead行开始变色，直到倒数iEnd行结束
    function addTableListener(o, iHead, iEnd) {
      o.style.cursor = "normal";
      iHead = iHead > o.rows.length ? 0 : iHead;
      iEnd = iEnd > o.rows.length ? 0 : iEnd;
      for (var i = iHead; i < o.rows.length - iEnd; i++) {
        o.rows[i].onmouseover = function () { setTrBgColor(this, true) }
        o.rows[i].onmouseout = function () { setTrBgColor(this, false) }
      }
    }


    function setTrBgColor(oTr, b) {
      oTr.style.backgroundColor = b ? aBgColor[3] : aBgColor[1];
    }
    window.onload = function () { addTableListener(document.getElementById("tbColor"), 0, 0); }
  </script>
  <%--<script src="../js/lodop4.0/CheckActivX.js" type="text/javascript"></script>
  <object id="LODOP" classid="clsid:2105C259-1E0C-4534-8141-A753534CB4CA" width="0"
    height="0">
  </object>--%>
  <script src="../js/Lodop6.010/LodopFuncs.js" type="text/javascript"></script>
  <object id="LODOP" classid="clsid:2105C259-1E0C-4534-8141-A753534CB4CA" width="0"
    height="0">
    <embed id="LODOP_EM" type="application/x-print-lodop" width="0" height="0" pluginspage="install_lodop.exe"></embed>
  </object>
</head>
<body>
  <form id="form2" runat="server">
  <table width="100%">
    <tr>
      <td align="center" width="70%">
        <asp:HyperLink ID="hlTX" runat="server">图形展示</asp:HyperLink>
        <asp:HyperLink ID="hlSJ" runat="server">数据查询</asp:HyperLink>
        <asp:Label ID="Label1" runat="server" Text="年份"></asp:Label>
        <asp:DropDownList ID="ddlYear" runat="server" OnSelectedIndexChanged="ddlYear_SelectedIndexChanged"
          AutoPostBack="true">
        </asp:DropDownList>
      </td>
    </tr>
  </table>
  </form>
  <form id="form1">
  <table width="600" align="center">
    <tr>
      <td colspan="6" style="font-size: 14px; text-align: center;">
        客户收费明细表
      </td>
    </tr>
  </table>
  <table width="600" style="font-size: 12px;" align="center">
    <tr>
      <td width="100px">
        客户编码
      </td>
      <td width="250px">
        <asp:Label ID="lbKHBM" runat="server" Text="Label"></asp:Label>
      </td>
      <td width="100px">
        履约保证金
      </td>
      <td width="200px">
        <asp:Label ID="lbLYBZJ" runat="server" Text="Label"></asp:Label>
      </td>
    </tr>
    <tr>
      <td>
        客户名称
      </td>
      <td colspan="3">
        <asp:Label ID="lbKHMC" runat="server" Text="Label"></asp:Label>
      </td>
      <%-- <td>
      </td>
      <td>
      </td>--%>
    </tr>
  </table>
  <table width="600" border="1" cellspacing="0" align="center" style="font-size: 12px;"
    class="table" id="tbColor">
    <tr>
      <td>
        时间
      </td>
      <td>
        数量（m<sup>3</sup>）
      </td>
      <td>
        应收金额（元）
      </td>
      <td>
        实收金额（元）
      </td>
      <td>
        结余金额（元）
      </td>
    </tr>
    <tr>
      <td>
        上年结转
      </td>
      <td>
        &nbsp;
      </td>
      <td>
        &nbsp;
      </td>
      <td>
        &nbsp;
      </td>
      <td>
        <asp:Label ID="lbSNJZ" runat="server" Text="Label"></asp:Label>
      </td>
    </tr>
    <%System.Data.DataSet ds = ZHCX.GetCBSF(CommonUse.GetID("khid"), ddlYear.SelectedValue);
      for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
      {
    %><tr>
      <td>
        <%=string.IsNullOrEmpty(ds.Tables[0].Rows[i]["cbsj"].ToString()) ? "&nbsp;" :
          ds.Tables[0].Rows[i]["cbsj"].ToString()%>
      </td>
      <td>
        <%=string.IsNullOrEmpty(ds.Tables[0].Rows[i]["ysql"].ToString()) ? "&nbsp;" :
           string.Format("{0:n}", Convert.ToDouble(ds.Tables[0].Rows[i]["ysql"].ToString()))%>
      </td>
      <td>
        <%=string.IsNullOrEmpty(ds.Tables[0].Rows[i]["ysfy"].ToString()) ? "&nbsp;" : 
           string.Format("{0:n}", Convert.ToDouble(ds.Tables[0].Rows[i]["ysfy"].ToString()))%>
      </td>
      <td>
        <%=string.IsNullOrEmpty(ds.Tables[0].Rows[i]["ssfy"].ToString()) ? "&nbsp;" :
           string.Format("{0:n}", Convert.ToDouble(ds.Tables[0].Rows[i]["ssfy"].ToString()))%>
      </td>
      <td>
        <%=string.IsNullOrEmpty(ds.Tables[0].Rows[i]["bcjyk"].ToString()) ? "&nbsp;" : 
          string.Format("{0:n}", Convert.ToDouble(ds.Tables[0].Rows[i]["bcjyk"].ToString()))%>
      </td>
    </tr>
    <%} %>
  </table>
  </form>
  <div style="text-align: center">
    <input type="button" value="打印预览" onclick="prn1_preview()">
    <%-- <input type="button" value="选择打印机" onclick="prn1_printA()">
    <input type="button" value="直接打印" onclick="prn1_print()">--%>
    <%--<input type="button" value="返回" onclick="history.go(-2)" />--%>
    <a href="KHQFMXList.aspx">返回</a>
    <script language="javascript" type="text/javascript">
      var LODOP; //声明为全局变量 

      function prn1_preview() {
        CreateOneFormPage();
        LODOP.PREVIEW();
      };
      function prn1_print() {
        CreateOneFormPage();
        LODOP.PRINT();
      };
      function prn1_printA() {
        CreateOneFormPage();
        LODOP.PRINTA();
      };
      function CreateOneFormPage() {
        LODOP = getLodop(document.getElementById('LODOP'), document.getElementById('LODOP_EM'));

        LODOP.PRINT_INIT("打印插件功能演示_Lodop功能_表单一");
        //LODOP.ADD_PRINT_TEXT(50, 231, 260, 39, "打印页面部分内容");
        //        LODOP.SET_PRINT_PAGESIZE(1, 2100, 880, "");

        //        LODOP.SET_PRINT_TEXT_STYLE(1, "宋体", 12, 1, 0, 0, 1);
        LODOP.ADD_PRINT_HTM(3, 10, 730, 600, document.getElementById("form1").innerHTML);
      };	
    </script>
  </div>
  <div align="center">
    如不能打印请下载右侧链接,安装后刷新页面<a href="../js/Lodop6.010/install_lodop.exe">请下载</a></div>
</body>
</html>
